package com.frame.work.handle;

import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.ExceptionUtils;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 全局异常捕获处理
 */
//@ControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler
    public void allExceptionHandler(Exception e) {
        //会记录出错的代码行等具体信息
        log.error("具体错误信息:[e]", e.getMessage());
        System.out.println("e = " + e);
    }

}
